Skip to content

feat(postgresflex): migrate to V2 api#1476

Open
SerseusWasTaken wants to merge 1 commit into
mainfrom
feat/postgresflex-sdk-migration
Open

feat(postgresflex): migrate to V2 api#1476
SerseusWasTaken wants to merge 1 commit into
mainfrom
feat/postgresflex-sdk-migration

Conversation

@SerseusWasTaken

@SerseusWasTaken SerseusWasTaken commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Description

Migrates postgresflex to the v2 API

relates to STACKITCLI-374

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see e.g. here)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

Relates to STACKITCLI-374
@SerseusWasTaken SerseusWasTaken requested a review from a team as a code owner July 15, 2026 13:15
@github-actions

Copy link
Copy Markdown

Merging this branch changes the coverage (2 decrease, 2 increase)

Impacted Packages Coverage Δ 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/backup/describe 68.09% (-0.80%) 👎
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/backup/list 54.72% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/backup/update-schedule 40.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/instance/clone 59.74% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/instance/create 60.00% (+0.40%) 👍
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/instance/delete 31.94% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/instance/describe 79.69% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/instance/list 52.08% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/instance/update 65.12% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/options 57.61% (+0.62%) 👍
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/user/create 59.18% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/user/delete 37.50% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/user/describe 69.05% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/user/list 54.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/user/reset-password 50.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/user/update 44.44% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/postgresflex/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/postgresflex/utils 82.09% (-0.26%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/backup/describe/describe.go 68.09% (-0.80%) 47 (+2) 32 (+1) 15 (+1) 👎
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/backup/list/list.go 54.72% (ø) 53 29 24
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/backup/update-schedule/update_schedule.go 40.00% (ø) 35 14 21
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/instance/clone/clone.go 59.74% (ø) 77 46 31
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/instance/create/create.go 60.00% (+0.40%) 100 (+1) 60 (+1) 40 👍
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/instance/delete/delete.go 31.94% (ø) 72 23 49
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/instance/describe/describe.go 79.69% (ø) 64 51 13
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/instance/list/list.go 52.08% (ø) 48 25 23
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/instance/update/update.go 65.12% (ø) 129 84 45
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/options/options.go 57.61% (+0.62%) 92 (-1) 53 39 (-1) 👍
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/user/create/create.go 59.18% (ø) 49 29 20
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/user/delete/delete.go 37.50% (ø) 40 15 25
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/user/describe/describe.go 69.05% (ø) 42 29 13
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/user/list/list.go 54.00% (ø) 50 27 23
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/user/reset-password/reset_password.go 50.00% (ø) 48 24 24
github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/user/update/update.go 44.44% (ø) 45 20 25
github.com/stackitcloud/stackit-cli/internal/pkg/services/postgresflex/client/client.go 0.00% (ø) 1 0 1
github.com/stackitcloud/stackit-cli/internal/pkg/services/postgresflex/utils/utils.go 82.09% (-0.26%) 67 (-1) 55 (-1) 12 👎

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/backup/describe/describe_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/backup/list/list_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/backup/update-schedule/update_schedule_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/instance/clone/clone_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/instance/create/create_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/instance/delete/delete_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/instance/describe/describe_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/instance/list/list_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/instance/update/update_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/options/options_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/user/create/create_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/user/delete/delete_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/user/describe/describe_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/user/list/list_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/user/reset-password/reset_password_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex/user/update/update_test.go
  • github.com/stackitcloud/stackit-cli/internal/pkg/services/postgresflex/utils/utils_test.go

}
if resp.Items == nil || len(*resp.Items) == 0 {
if len(resp.Items) == 0 {
params.Printer.Outputf("No backups found for instance %q", instanceLabel)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

invalid JSON/YAML output

}

return p.OutputResult(outputFormat, resp, func() error {
if resp == nil {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks 😅

@@ -77,7 +77,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
params.Printer.Info("No instances found for project %q\n", projectLabel)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid JSON/YAML output

table.SetHeader("MINIMUM", "MAXIMUM", "STORAGE CLASS")
for i := range storages {
sc := storages[i]
for i := range storagesResp.StorageClasses {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for i := range storagesResp.StorageClasses {
for _, sc := range storagesResp.StorageClasses {

instanceLabel = *model.InstanceId
instanceLabel = model.InstanceId
}
params.Printer.Info("No users found for instance %q\n", instanceLabel)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid JSON/YAML output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants